{extend name="../back" /}
{block name="main"}
<div class="w-100 d-flex justify-content-start align-items-center mb-3">
  <div class="dropdown">
    <button type="button" class="btn btn-dark btn-sm dropdown-toggle" data-bs-toggle="dropdown"><i class="bi-tools mx-1"></i>批量操作</button>
    <div class="dropdown-menu">
      <a class="dropdown-item xf-batch" href="{:xfUrl('blog/admin.type/normal')}"><i class="bi-eye me-1"></i>显示</a>
      <a class="dropdown-item xf-batch" href="{:xfUrl('blog/admin.type/hidden')}"><i class="bi-eye-slash me-1"></i>隐藏</a>
      <li><hr class="dropdown-divider"></li>
      <a class="dropdown-item xf-batch" href="{:xfUrl('blog/admin.type/deletes')}" data-delete="1"><i class="bi-trash me-1 text-danger"></i>删除</a>
    </div>
  </div>
  <div class="btn-group btn-group-sm ms-3" role="group">
    <a class="btn btn-secondary" href="{:xfUrl('blog/admin.type/create')}" data-toggle="create"><i class="bi-plus mx-1"></i>添加</a>
    <a class="btn btn-secondary d-none" href="{:xfUrl('blog/admin.type/index')}"><i class="bi-list mx-1"></i>全部</a>
    <button type="button" class="btn btn-secondary btn-sm dropdown-toggle" data-bs-toggle="dropdown"><i class="bi-filter mx-1"></i>筛选</button>
    <div class="dropdown-menu">
      <a class="dropdown-item {empty name='query'}active{/empty}" href="{:xfUrl('blog/admin.type/index')}"><i class="bi-list me-1"></i>全部</a>
      <a class="dropdown-item {:xfActive($query['status'],'normal')}" href="{:xfUrlFilter('blog/admin.type/index',['status'=>'normal'],$query)}"><i class="bi-eye me-1"></i>显示</a>
      <a class="dropdown-item {:xfActive($query['status'],'hidden')}" href="{:xfUrlFilter('blog/admin.type/index',['status'=>'hidden'],$query)}"><i class="bi-eye-slash me-1"></i>隐藏</a>
    </div>
  </div>
  <form class="ms-3" action="{:xfUrl('blog/admin.type/index')}" method="get">
    <div class="input-group input-group-sm">
      <input class="form-control" type="text" name="searchText" placeholder="名称" autocomplete="off" required>
      <button class="btn btn-secondary" type="submit">搜索</button>
    </div>
  </form>
</div>
<table class="table table-striped table-bordered table-hover mb-0">
  <thead>
    <tr>
      <th class="td-id"><input name="checkAll" type="checkbox"></th>
      <th class="td-id">ID</th>
      <th class="td-id">权重</th>
      <th class="td-field">排序</th>
      <th class="text-left">分类名称</th>
      <th class="td-field">唯一标识</th>
      <th class="td-field">显示状态</th>
      <th class="td-field">数据统计</th>
      <th class="td-field">菜单分组</th>
      <th class="td-field">分页大小</th>
      <th class="td-field">模板名</th>
      <th class="td-op">操作</th>
    </tr>
  </thead>
  <tbody>
    {volist name="data" id="item"}
    <tr class="{if $item['level']}text-muted{/if}">
      <td class="td-id"><input name="id[]" type="checkbox" value="{$item.type_id}"></td>
      <td class="td-id">{$item.type_id}</td>
      <td class="td-id">{$item.type_weight}</td>
      <td class="td-field">
        <a class="px-1 xf-weight" href="{:xfUrl('blog/admin.type/weight',['id'=>$item['type_id'],'value'=>1])}"><i class="bi-arrow-up"></i></a>
        <a class="px-1 xf-weight" href="{:xfUrl('blog/admin.type/weight',['id'=>$item['type_id'],'value'=>-1])}"><i class="bi-arrow-down"></i></a>
      </td>
      <td class="text-left">{$item.type_name}</td>
      <td class="td-field">{$item.type_slug}</td>
      <td class="td-field">{$item.type_status|xfStatus}</td>
      <td class="td-field">{$item.type_count}</td>
      <td class="td-field">{$item.type_menu}</td>
      <td class="td-field">{$item.type_limit}</td>
      <td class="td-field">{$item.type_tpl}</td>
      <td class="td-op">
        <a class="px-1 text-danger" href="{:xfUrl('blog/admin.type/delete',['id'=>$item['type_id']])}" data-toggle="delete">删除</a>
        <a class="px-1 text-dark" href="{:xfUrl('blog/admin.type/edit',['id'=>$item['type_id']])}" data-toggle="edit">修改</a>
        <a class="px-1 text-primary" href="{:xfUrlType($item,1)}" target="_blank">预览</a>
      </td>
    </tr>
  {/volist}
  </tbody>
</table>
{/block}